/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package session03;

import java.io.File;

/**
 *
 * @author macbookpro
 */
public class FileTest {

    public static void main(String[] args) {
//        String file = "File.rtf";
        String file = "./";

        File f = new File(file);

        if (f.exists()) {
            if (f.isFile()) {
                System.out.println("Duong dan file: " + f.getPath());
            } else {
                System.out.println(file + " la thu muc.");
                File list[] = f.listFiles();

                //Hien thi danh sach file, thu muc trong thu muc nay
                for (File f1 : list) {
                    System.out.println("--" + f1.getName());
                }
            }
        } else {
            System.out.println("File " + file + " khong ton tai.");
        }
    }
}
